package per.sunmes.cl.g.screen;

import per.sunmes.cl.g.gsys.CardFactory;
import per.sunmes.cl.g.listeners.BtnColorChangeListener;
import per.sunmes.cl.g.sys.G;
import per.sunmes.cl.g.sys.U;

import com.badlogic.gdx.scenes.scene2d.Group;
import com.badlogic.gdx.scenes.scene2d.actions.Actions;
import com.badlogic.gdx.scenes.scene2d.ui.Image;

public class TitleScreen extends Group {

	public TitleScreen() {
		U.stageSize(this);

		Image bg = U.createMask();
		addActor(bg);

		Image btnPlay = U.image("dialog/btn_demo.png");
		addActor(btnPlay);
		U.centerParent(btnPlay, this);
		btnPlay.addListener(new BtnColorChangeListener() {
			public void btnClick() {
				G.gameActor.startDemoGame();
			}
		});

		btnPlay.getColor().a = 0;
		btnPlay.addAction(Actions.sequence(Actions.delay(0.3f),
				Actions.fadeIn(0.5f)));
		// ///////
		init();
	}

	private void init() {
		U.getFontGenerator();
		U.getCardNameFont();
		U.getCardTxtFont();

		CardFactory.loadDatas();
	}
}
